const AutoImport = require('unplugin-auto-import/webpack');
const Components = require('unplugin-vue-components/webpack');
const {ElementPlusResolver} = require('unplugin-vue-components/resolvers');


module.exports = {
	/**
	 * element plus 配置
	 * @param config
	 */
	configureWebpack: config => {
		config.plugins.push(AutoImport({
			resolvers: [ElementPlusResolver()]
		}));

		config.plugins.push(Components({
			resolvers: [ElementPlusResolver()]
		}));

		config.module.rules.push({
			test: /\.mjs$/,
			include: /node_modules/,
			type: "javascript/auto"
		})
	}

	// { test: /\.css$/, use: ['style-loader', 'css-loader']}

};